import React, { useState } from 'react'
import {View, Text, Input, Image, Textarea, Span, Button} from '@tarojs/components'
import PageWrapper from '@/components/PageWrapper'
import './index.scss';
import {navigateTo} from "@/utils/navigation";
import MultiImageUploader from "@/components/MultiImageUploader/MultiImageUploader";
const Page = () => {
  const items = [1, 2, 3]
  const [images, setImages] = useState<string[]>([])
  const [formData, setFormData] = useState({
    externalOrderId: '2290023843944107980',
  });
  const handleInputChange = (e: any, field: string) => {
    setFormData({
      ...formData,
      [field]: e.detail.value
    });
  };
  return (
    <PageWrapper title="换货" showBack={true} backgroundColor='#FE7407' color="#ffffff">
      <View className="my-service-page">
        <View className="my-service"></View>
        <View className="box">
          <View className="warehouse">
            <View className="item-info">
              <Image className="item-img" src={require(`../../../assets/photo.png`)}/>
              <View className="item-text">
                <View className="black">汾酒封坛15年老白汾53度475ML清香型</View>
                <View className="grey">规格描述:2022年;颇色分类:单瓶装</View>
                <View className="orange">状态:待入库</View>
              </View>
            </View>
            <View className="section">
              <View className="section-title">商家换货操作 需提交以下信息</View>
              <View className="form-item">
                <Text className="label">备注原因：</Text>
                <Input
                  className="input"
                  value={formData.externalOrderId}
                  onInput={(e) => handleInputChange(e, 'externalOrderId')}
                />
              </View>
            </View>
            <View className="section">
              <View className="section-title">证据图片</View>
              <View className="sell-text-upimg">
                <MultiImageUploader
                  maxCount={9}
                  value={images}
                  onChange={(newList) => setImages(newList)}
                />
              </View>
            </View>
          </View>


          <View className="submit-box">
            <View className="submit-but">提交</View>
          </View>

        </View>
      </View>
    </PageWrapper>
  )
}

export default Page
